<?php

namespace App\Controller\Report;


use App\Controller\BaseController;
use App\Request\Report\TipOffCreateRequest;
use App\Request\Report\TipOffListRequest;
use App\Services\Report\TipOffService;
use Hyperf\Context\Context;
use Hyperf\Di\Annotation\Inject;

class TipOffController extends BaseController
{

    #[Inject]
    public TipOffService $tipOffService;


    /**
     * Note - 举报
     * DateTime 2024/8/8 10:18
     * User Admin
     * @return mixed
     */
    public function create(TipOffCreateRequest $request)
    {
        $userInfo = Context::get('user');
        $params = $this->request->post();
        $request->execute($params);
        return $this->return($this->tipOffService->create($userInfo, $params));
    }


    /**
     * Note - 举报记录
     * DateTime 2024/8/8 10:19
     * User Admin
     * @return mixed
     */
    public function journal(TipOffListRequest $request)
    {
        $userInfo = Context::get('user');
        $params = $this->request->post();
        $request->execute($params);
        $params['language'] = Context::get('language');
        return $this->return($this->tipOffService->journal($userInfo, $params));
    }

}